#include <iostream>
using namespace std;

const int kMaxH = 3010;
const int kMaxW = 3010;

bool holed[kMaxH][kMaxW];
int up_[kMaxH][kMaxW], left_[kMaxH][kMaxW], f[kMaxH][kMaxW];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int h, w, n;
  cin >> h >> w >> n;
  for (int i = 0; i < n; i++) {
    int a, b;

    cin >> a >> b;
    holed[a][b] = true;
  }
  long long ans = 0;
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      if (holed[i][j]) {
        f[i][j] = up_[i][j] = left_[i][j] = 0;
      } else {
        up_[i][j] = up_[i - 1][j] + 1;
        left_[i][j] = left_[i][j - 1] + 1;
        f[i][j] = min(f[i - 1][j - 1] + 1, min(up_[i][j], left_[i][j]));
        ans += f[i][j];
      }
    }
  }
  cout << ans << "\n";
  return 0;
}